import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../config/config.dart';
import '../../views/common_widget.dart';
import 'logic.dart';

class FamilySharePage extends StatelessWidget {
  FamilySharePage({super.key});

  final logic = Get.find<FamilyShareLogic>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Config.colorBg,
      resizeToAvoidBottomInset: false,
      body: Column(
        children: [
          CommonWidget.commonAppBar("家庭共享"),
          Container(
            width: Get.width,
            margin: EdgeInsets.only(left: 35.w, right: 35.w, top: 30.w),
            padding: EdgeInsets.symmetric(vertical: 30.w, horizontal: 30.w),
            decoration: BoxDecoration(
              color: Config.colorBg2,
              borderRadius: BorderRadius.circular(Config.roundBig.w),
            ),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  "填写被邀请人的手机号",
                  style: TextStyle(color: Config.colorText1, fontSize: Config.textSizeSubTitle.sp),
                ),
                SizedBox(
                  height: 10.w,
                ),
                Text(
                  "邀请成功后被邀请人使用手机号进行登录，登录成功后可接收邀请查看邀请人账号下的所有设备。邀请时效为24小时，失效后请重新发送邀请",
                  style: TextStyle(color: Config.colorText3, fontSize: Config.textSizeContent.sp),
                ),
              ],
            ),
          ),
          Container(
            width: Get.width,
            margin: EdgeInsets.only(left: 35.w, right: 35.w, top: 30.w),
            padding: EdgeInsets.symmetric(vertical: 30.w, horizontal: 30.w),
            decoration: BoxDecoration(
              color: Config.colorBg2,
              borderRadius: BorderRadius.circular(Config.roundBig.w),
            ),
            child: Row(
              children: [
                Text(
                  "手机号",
                  style: TextStyle(color: Config.colorText1, fontSize: Config.textSizeContent.sp),
                ),
                SizedBox(
                  width: 20.w,
                ),
                Container(
                  width: 1.8.w,
                  height: 36.w,
                  color: Config.colorDivider,
                ),
                SizedBox(
                  width: 20.w,
                ),
                Expanded(
                  child: TextField(
                    keyboardType: TextInputType.phone,
                    textAlign: TextAlign.left,
                    maxLength: 11,
                    maxLines: 1,
                    cursorColor: Config.colorMain,
                    onChanged: (value) {},
                    onTap: () {},
                    enabled: true,
                    // controller: controller,
                    style: TextStyle(fontSize: Config.textSizeContent.sp, color: Config.colorText1),
                    decoration: InputDecoration(
                      isDense: true,
                      // 紧凑模式
                      hintText: "输入手机号",
                      counterText: '',
                      hintStyle:
                          TextStyle(fontSize: Config.textSizeContent.sp, color: Config.colorText3),
                      border: InputBorder.none,
                      filled: false,
                      prefixIcon: null,
                      contentPadding: EdgeInsets.symmetric(vertical: 0.w, horizontal: 0.w),
                    ),
                  ),
                ),
              ],
            ),
          ),
          Expanded(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.end,
              children: [
                CommonWidget.commonButton("确认邀请", () {}, width: 650.w,radius: 50.w),
                SizedBox(height: 120.w)
              ],
            ),
          ),
        ],
      ),
    );
  }
}
